package com.example.demo.reflection;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * Description: 反射之成员变量获取<br/>
 *
 * @author liulonglong
 * @taskId <br/>
 * @Date 2019/11/27 15:09
 * @Version 1.0
 */
@NoArgsConstructor
@ToString
@Setter
@Getter
public class Teacher extends Person {

    private String name;

    char sex;

    public String phone;

    protected int age;

    //**************成员方法***************//
    public void show1(String s) {
        System.out.println("调用了：公有的，String参数的show1(): s = " + s);
    }

    protected void show2() {
        System.out.println("调用了：受保护的，无参的show2()");
    }

    void show3() {
        System.out.println("调用了：默认的，无参的show3()");
    }

    private String show4(int age) {
        System.out.println("调用了，私有的，并且有返回值的，int参数的show4(): age = " + age);
        return "abcd";
    }

}
